<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested"%>
<%@page import="com.lawyers.common.*"%>


<html:html>
<jsp:include page="/jsp/header.jsp" flush="true" />
<body>
	<div id="header">
		<div class="logout">
		<html:form action="LogOff"> 
			<nested:hidden property="username"/>
			<b>Usuario:</b>
			<%=((UserVO) session.getAttribute("USUARIO")).getUsername()%><br />
			<input type="button" name="salir" id="salir" value="Salir" class="botonbox"/>
		</html:form>			
		</div>
		<div style="clear: both"></div>
	</div>
	<table style="border-collapse:collapse;">
	<tr>
	<td id="menu_lat" valign="top">
	<jsp:include page="/jsp/menuLateral.jsp" flush="true" />
	</td>
	<td width="100%" valign="top">
	<div>
		<table>
			<tr>
				<td valign="top">
					<h4><bean:message key="menu.lateral.mis.demandas"/></h4>
				</td>
			</tr>
			<tr><td>&nbsp;</td></tr>
		</table>
		<table align="center" style="width: 80%;" >
			<tr align="center">
				<td>
				<html:form action="ListarMisDemandas" >
					<nested:hidden property="accion" />
					<nested:hidden property="idDemanda" />
					<nested:notEmpty name="misDemandasForm" property="demandas">
					<table class="resultados" align="center" style="width: 90%;">
						<tr class="titulo">
							<td align="center"><bean:message key="subir.documento.autos" /></td>
							<td align="center"><bean:message key="subir.documento.fecha" /></td>
							<td align="center">&nbsp;</td>
						</tr>
						<logic:iterate id="misDemandas" name="misDemandasForm" property="demandas">
							<tr>
								<td class="datacelda" align="center">
								<bean:write name="misDemandas" property="autos"/></td>
								<td class="datacelda" align="center">
								<bean:write name="misDemandas" property="fecha"/></td>
								<td class="datacelda" align="center"><input type="button" class="botonbox" value="<bean:message key="lista.demandas.detalles"/>" onclick="cargar('<bean:write name="misDemandas" property="idDemanda"/>');"/></td>
							</tr>
						</logic:iterate>
					</table>
					</nested:notEmpty>
					<nested:empty name="misDemandasForm" property="demandas">
						<table align="center" style="width: 90%;">
							<tr class="titulo">
								<td align="center"><bean:message key="lista.demandas.vacia" /></td>
							</tr>
						</table>
					</nested:empty >
				</html:form>
				</td>
			</tr>
		</table>
	</div>
	</td>
	</tr>
	</table>
	<br />
	<div id="footer">
		2011 &copy; Zeus Lawyer - Aplicaci&oacute;n web desarrollada por Los
		pibe que no la ponen<br /> <br />
	</div>
	<script type="text/javascript">
		window.onload = function(){
			document.getElementById("salir").onclick = function (){
				document.logOffForm.username.value = "<%=((UserVO) session.getAttribute("USUARIO")).getUsername()%>";
				document.logOffForm.submit();
			}
		}
		
		function cargar(id) {
			document.misDemandasForm.accion.value = 'cargar';
			document.misDemandasForm.idDemanda.value = id;
			document.misDemandasForm.submit();
		}
		
	</script>
</body>
</html:html>

